package com.cg.controller;

import com.cg.config.jwt.JwtAuthService;
import com.cg.entity.User;
import com.cg.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class HelloController {

    @Autowired
    UserMapper userMapper;


    @GetMapping("/hello")
    public String hello(){
        return "welcome come here";
    }

    @GetMapping("/userList")
    public List<User> userList(){
        List<User> userList = userMapper.getAllUsers();
        return userList;
    }


}
